#!/bin/bash

# Replace these three settings.
PROJDIR='/home/nachopro/djsites/nachopro'
PIDFILE='/home/nachopro/djsites/nachopro/fcgi.pid'
SOCKET='/home/nachopro/djsites/nachopro/fcgi.sock'

cd $PROJDIR
if [ -f $PIDFILE ]; then
    kill `cat -- $PIDFILE`
    rm -f -- $PIDFILE
fi

/usr/bin/env - \
  PYTHONPATH="../python:.." \
  ./manage.py runfcgi socket=$SOCKET pidfile=$PIDFILE

chown lighttpd:lighttpd $SOCKET

